package base

import (
	"fmt"
	"time"
)

func ForTest() {
	count := 0
	for i := 1; i < 100; i++ {
		if i%2 == 0 {
			fmt.Println(i)
			count++
		}
	}
	fmt.Println("偶数个数:", count)
}

func ForDead() {
	for {
		now := time.Now().Format("2006-01-02 15:04:05")
		fmt.Println(now, "对不起！")
		time.Sleep(time.Second)
	}
}

func BcTest(useBreak bool) {
	for i := 0; i < 100; i++ {
		if i == 88 {
			fmt.Println("找到了88")
			if useBreak {
				break
			} else {
				continue
			}
		}
		fmt.Println(i)
	}
}
